﻿<%@ Page Title="家乐福——冠军宝贝在我家" Language="C#" MasterPageFile="~/MasterPageNavStepTwoCol.master"
    AutoEventWireup="true" CodeBehind="ViewBabyGroup.aspx.cs" Inherits="WebSite.ViewBabyGroup" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="js/baby.js" type="text/javascript"></script>
    <script src="js/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
    <link href="js/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
    <link href="js/jquery.colorbox/colorbox.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <link href="css/ImageUploadCut.css" rel="stylesheet" type="text/css" />
    <script src="js/ImageUploadCut.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        <div class="twobabyphoto teambabyphoto">
            <div>
                <img alt="teamimg" class="imgteam imgteam_big wbshare" src="<%= curTeam.TeamHeadImg %>" />
            </div>
            <div class="centertext">
                <div class="hgiconc">
                    <!--
                    <a href="javascript:void(0);" onclick="voteTeam(<%= curTeam.Id %>, $(this).parent().find('.voteCount') );">
                        <img class="govote " src="images/BabyGroup/geiwomentoupiao_big.png" />
                    </a>-->
                    <!--
                    <div class="votestatarea">
                        <span class="voteCount">
                            <%= curTeam.TeamVoteNum %></span>&nbsp;票 
                    </div>
                    -->
                    <%--<div><span class="ft_18">决赛即将开始，敬请期待</span></div>--%>
                    <% 
                        int teamtype = Common.NullableHelper.CastValueType(curTeam.Type);
                        string[] scores = (curTeam.Ip ?? ",").Split(new char[] { ',' }, 2);
                        
                        if (teamtype == 0)
                        {
                    %>
                        <div><a href="/Intro.aspx"><span class="ft_bold ft_24 orange2">晋级赛票数：<%= curTeam.TeamVoteNum %> 票</a></div>
                    <%
                        }
                        else if (teamtype == 1)
                        {
                    %>
                        <div>
                            <a href="/Intro.aspx">
                                <span class="ft_18">
                                    晋级赛票数：<%= curTeam.TeamVoteNum %> 票
                                    晋级赛评委分：<%= scores[0] %>分 
                                    晋级赛总分：<%= scores.Length > 1 ? scores[1] : "" %>分
                                </span>
                            </a>
                        </div>
                    <%
                        }
                        else if (teamtype == 2)
                        { %>
                            <div><span class="ft_bold ft_24 orange2 wincuptext">线上晋级宝宝帮</span></div>
                            <div>
                            <a href="/Intro.aspx">
                                <span class="ft_18">
                                    晋级赛票数：<%= curTeam.TeamVoteNum %> 票
                                    晋级赛评委分：<%= scores[0] %>分 
                                    晋级赛总分：<%= scores.Length > 1 ? scores[1] : "" %>分
                                </span>
                            </a>
                        </div>
                    <%  
                        }
                        else if (teamtype >= 10)
                        {
                            string cityname = "";
                            switch (teamtype)
                            {
                                case 15:
                                    cityname = "成都";
                                    break;
                                case 14:
                                    cityname = "宁波";
                                    break;
                                case 13:
                                    cityname = "深圳";
                                    break;
                                case 12:
                                    cityname = "北京";
                                    break;
                                case 11:
                                    cityname = "沈阳";
                                    break;
                                case 10:
                                default:
                                    cityname = "上海";
                                    break;
                            }
                    %>
                            <div><span class="ft_bold ft_24 orange2 wincuptext"><%=cityname%>站线下晋级宝宝帮</span></div>
                    <%
                        }  
                    %>
                   
                </div>
                <div>
                </div>
            </div>
        </div>
        <div class="babygrouptitle">
            <span class="Top ft_14">
                <%= curTeam == null ? babyA.BabyTeamName : curTeam.TeamName %></span>
        </div>
        <div class="babygroupslogan">
            <div class="Yahei slogantext">
                <%= babyA.BabyTeamDeclaration %></div>
        </div>
        <div class="twobabyintro">
            <div>
                <div class="babyintro baby1">
                    <div class="orange ft_bold">
                        *宝宝编号为
                        <%= babyA.Id %></div>
                    <div class="textpart">
                        <p>
                            宝宝姓名：<%= babyA.BabyName %></p>
                        <p>
                            生日：<%= Common.NullableHelper.CastValueType( babyA.BabyBirthday ).ToString("yyyy-MM-dd") %></p>
                        <p>
                            年龄：<%= WebSite.Core.AgeCalcHelper.AgeCalc( babyA.BabyBirthday ) %></p>
                        <p>
                            性别：<%= Common.NullableHelper.CastValueType( babyA.BabySex ) ==1 ? "男" : "女" %></p>
                        <p>
                            城市：<%=babyA.LiveProvince %></p>
                    </div>
                    <div>
                        &nbsp;</div>
                    <div class="orange ft_bold">
                        宝宝介绍：</div>
                    <div>
                        <p>
                            <%= babyA.Introduction %></p>
                    </div>
                </div>
                <div class="babysepar">
                </div>
                <div class="babyintro baby2">
                    <div class="orange ft_bold">
                        *宝宝编号为
                        <%= babyB == null ? "" : babyB.Id.ToString() %></div>
                    <div class="textpart">
                        <p>
                            宝宝姓名：<%= babyB == null ? "" : babyB.BabyName%></p>
                        <p>
                            生日：<%= babyB == null ? "" : Common.NullableHelper.CastValueType( babyB.BabyBirthday ).ToString( "yyyy-MM-dd" )%></p>
                        <p>
                            年龄：<%= babyB == null ? "" : WebSite.Core.AgeCalcHelper.AgeCalc( babyB.BabyBirthday )%></p>
                        <p>
                            性别：<%= babyB == null ? "" : Common.NullableHelper.CastValueType( babyB.BabySex ) == 1 ? "男" : "女"%></p>
                        <p>
                            城市：<%= babyB == null ? "" : babyB.LiveProvince%></p>
                    </div>
                    <div>
                        &nbsp;</div>
                    <div class="orange ft_bold">
                        宝宝介绍：</div>
                    <div>
                        <p>
                            <%=babyB == null ? "" : babyB.Introduction%></p>
                    </div>
                </div>
                <div class="clearfloat">
                </div>
            </div>
        </div>
        <div class="babygrouptitlehighlight">
            <!--  
            <div>
                <img src="images/BabyGroup/demo_upload.png" />
            </div>
            <div class="lefttext">
                <img src="images/BabyGroup/uploadintro.png" />
            </div>
            -->
        </div>
        <div class="PhotoGroup">
            <div class="PhotoGroupText">
                <div class="yahei Text" style="">
                    <%= babyA.BabyName%></div>
            </div>
            <div class="PhotoGroupItem">
                <img class="wbshare" src="<%= babyAHeadImage %>" />
            </div>
            <div class="PhotoGroupItem">
                <img class="wbshare" src="<%=babyALiveImage1 %>" />
            </div>
            <div class="PhotoGroupItem">
                <img class="wbshare" src="<%=babyALiveImage2 %>" />
            </div>
            <div class="clearfloat">
            </div>
        </div>
        <div class="PhotoGroup">
            <div class="PhotoGroupText">
                <div class="yahei Text" style="">
                    <%= babyB == null ? "" : babyB.BabyName%></div>
            </div>
            <div class="PhotoGroupItem">
                <img class="wbshare" src="<%= babyBHeadImage %>" />
            </div>
            <div class="PhotoGroupItem">
                <img class="wbshare" src="<%=babyBLiveImage1 %>" />
            </div>
            <div class="PhotoGroupItem">
                <img class="wbshare" src="<%=babyBLiveImage2 %>" />
            </div>
            <div class="clearfloat">
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function callbackUploadHead(url) {
            $.ajax(
            {
                url: "/Server/UpdateTeamImg.ashx",
                data: { "img": url },
                cache: false,
                type: "POST",
                success: function (data, textStatus, jqXHR) {
                    if (data.code == 1) {
                        alert('组队头像更新成功');
                        window.location = "/babygroup.aspx";
                    }
                    else {
                        alert(data.message);
                    }
                },
                error: function () {
                    alert("系统错误");
                }
            });

            $.fn.colorbox.close();
        }
        $(document).ready(function () {
            SetUploadifyForTeamHead($("#uploadTeamHeadImageFile"), "callbackUploadHead");
        });
    </script>
</asp:Content>
